package com.zdsoft.finance.busiform.service;

import com.zdsoft.finance.busiform.entity.BusiForm;
import com.zdsoft.finance.common.exception.BusinessException;

import java.util.List;
import java.util.Map;

/**
 * 审批单业务逻辑接口类
 * 
 * @author liuwei
 * @date 2016/10/12
 * @version 1.0
 *
 */
public interface BusiFormService {

    /**
     * 按照ID查询
     * @param id ID
     * @return
     * @throws BusinessException
     */
    public BusiForm findById(String id) throws BusinessException;

    /**
     * 更改状态
     * @param busiform 需要更改的busiform
     * @param status
     * @return
     * @throws BusinessException
     */
    public BusiForm updateBusiFormStatus(BusiForm busiform,Integer status) throws BusinessException;

	/**
	 * 根据审批单编号查询
	 * 
	 * @param busiFormNo
	 *            审批单编号
	 * @return 审批单
	 */
	BusiForm findByBusiFormNo(String busiFormNo);

	/**
	 * 根据关联业务id以及关联业务类型进行查询
	 * 
	 * @param businessId
	 *            关联业务id
	 * @param businessType
	 *            关联业务类型
	 * @return 审批单
	 */
	BusiForm findByBusinessIdAndBusinessType(String businessId, String businessType);

	/**
	 * 申请业务编号
	 * 
	 * @return 业务编号
	 */
	String applyBusiFormNo();

	/**
	 * 保存审批单
	 * 
	 * @param busiForm
	 *            审批单
	 * @return 审批单
	 */
	BusiForm save(BusiForm busiForm);

	/**
	 * 修改审批单
	 * 
	 * @param busiForm
	 *            审批单
	 * @return 审批单
	 */
	BusiForm update(BusiForm busiForm);

	/**
	 * 逻辑删除审批单
	 * 
	 * @param businessId
	 *            关联业务标识id
	 * @param businessType
	 *            关联业务类型
	 */
	public BusiForm logicDelete(String businessId, String businessType);

    /**
     * 多条件查询
     * @param condition 查询条件
     * @return
     */
    public List<BusiForm> findByCondition(Map<String,Object> condition);

}
